![]() |
WOLF core
WOLF: A Modular Estimation Framework for Robotics
|
Buffer for arbitrary type objects. More...
#include <core/processor/buffer.h>
Public Types | |
| typedef std::map< TimeStamp, T >::iterator | Iterator |
| Buffer iterator. More... | |
| typedef std::map< TimeStamp, T >::const_iterator | ConstIterator |
| Buffer const iterator. More... | |
Public Member Functions | |
| Buffer () | |
| Default constructor. More... | |
| ~Buffer (void) | |
| Destructor. More... | |
| T | select (const TimeStamp &_time_stamp, const double &_time_tolerance) const |
| Select an element from the buffer. More... | |
| ConstIterator | selectIterator (const TimeStamp &_time_stamp, const double &_time_tolerance) const |
| Select an element iterator from the buffer. More... | |
| Iterator | selectIterator (const TimeStamp &_time_stamp, const double &_time_tolerance) |
| Select an element iterator from the buffer (see the const version) More... | |
| T | selectFirstBefore (const TimeStamp &_time_stamp, const double &_time_tolerance) const |
| Returns the oldest element if it is older than _time_stamp or within the time tolerance (T() otherwise) More... | |
| T | selectLastAfter (const TimeStamp &_time_stamp, const double &_time_tolerance) const |
| Returns the newest element if it is newer than _time_stamp or within the time tolerance (T() otherwise) More... | |
| T | selectFirst () const |
| Returns the oldest element (T() if empty) More... | |
| T | selectLast () const |
| Returns the newest element (T() if empty) More... | |
| SizeStd | size (void) const |
| Returns the number of elements of the buffer. More... | |
| void | emplace (const TimeStamp &_time_stamp, const T &_element) |
| Adds an element to the buffer. More... | |
| const std::map< TimeStamp, T > & | getContainer () const |
| Returns the container with elements of the buffer. More... | |
| std::map< TimeStamp, T > & | getContainer () |
| Returns the container with elements of the buffer. More... | |
| void | removeUpTo (const TimeStamp &_time_stamp) |
| Removes all elements in the buffer with a time stamp older than or equal to the specified. More... | |
| void | removeUpToLower (const TimeStamp &_time_stamp) |
| Removes all elements in the buffer with a time stamp older than the specified. More... | |
| void | clear () |
| Clears the buffer. More... | |
| bool | empty () const |
| Returns whether the buffer is empty. More... | |
Static Public Member Functions | |
| static bool | checkTimeTolerance (const TimeStamp &_time_stamp1, const TimeStamp &_time_stamp2, const double &_time_tolerance) |
| Returns whether the time distance between two time stamps is smaller than or equal to the time tolerance. More... | |
| static bool | doubleCheckTimeTolerance (const TimeStamp &_time_stamp1, const double &_time_tolerance1, const TimeStamp &_time_stamp2, const double &_time_tolerance2) |
| Returns whether the time distance between two time stamps is smaller than or equal to the minimum of their time tolerances. More... | |
Protected Attributes | |
| std::map< TimeStamp, T > | container_ |
| Main buffer container, ordered by time stamp. More... | |
Buffer for arbitrary type objects.
Object and functions to manage a buffer of objects.
| typedef std::map<TimeStamp,T>::const_iterator wolf::Buffer< T >::ConstIterator |
Buffer const iterator.
| typedef std::map<TimeStamp,T>::iterator wolf::Buffer< T >::Iterator |
Buffer iterator.
|
inline |
Default constructor.
|
inline |
Destructor.
|
inlinestatic |
Returns whether the time distance between two time stamps is smaller than or equal to the time tolerance.
|
inline |
Clears the buffer.
|
inlinestatic |
Returns whether the time distance between two time stamps is smaller than or equal to the minimum of their time tolerances.
|
inline |
Adds an element to the buffer.
|
inline |
Returns whether the buffer is empty.
|
inline |
Returns the container with elements of the buffer.
|
inline |
Returns the container with elements of the buffer.
Elements are ordered by time stamp, from oldest to most recent
|
inline |
Removes all elements in the buffer with a time stamp older than or equal to the specified.
|
inline |
Removes all elements in the buffer with a time stamp older than the specified.
|
inline |
Select an element from the buffer.
Select from the buffer the closest element (w.r.t. time stamp), respecting a defined time tolerances
|
inline |
Returns the oldest element (T() if empty)
|
inline |
Returns the oldest element if it is older than _time_stamp or within the time tolerance (T() otherwise)
|
inline |
Select an element iterator from the buffer (see the const version)
|
inline |
Select an element iterator from the buffer.
Select from the buffer the iterator pointing to the closest element (w.r.t. time stamp), respecting a defined time tolerances
|
inline |
Returns the newest element (T() if empty)
|
inline |
Returns the newest element if it is newer than _time_stamp or within the time tolerance (T() otherwise)
|
inline |
Returns the number of elements of the buffer.
|
protected |
Main buffer container, ordered by time stamp.